/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */
#ifndef CUSTOM_BOARD_H
#define CUSTOM_BOARD_H

// LEDs definitions for PCA10028
#define LEDS_NUMBER    2

#define LED_START      7
#define LED_1          7
#define LED_2          8
#define LED_3          20
#define LED_4          20
#define LED_STOP       20

#define LED_PIN        7

#define LEDS_LIST {LED_1, LED_2}

#define BSP_LED_0      LED_1        /*  System status, such as BLE connect status, Working status */
#define BSP_LED_1      LED_2        /*  Battery & charger status, such as low battery, charging, charge complete */
//#define BSP_LED_2      LED_3
//#define BSP_LED_3      LED_4

#define BSP_LED_0_MASK (1<<BSP_LED_0)
#define BSP_LED_1_MASK (1<<BSP_LED_1)
//#define BSP_LED_2_MASK (1<<BSP_LED_2)
//#define BSP_LED_3_MASK (1<<BSP_LED_3)

//#define LEDS_MASK      (BSP_LED_0_MASK | BSP_LED_1_MASK | BSP_LED_2_MASK | BSP_LED_3_MASK)
#define LEDS_MASK      (BSP_LED_0_MASK | BSP_LED_1_MASK)
/* all LEDs are lit when GPIO is low */
#define LEDS_INV_MASK  ~LEDS_MASK

#define BUTTONS_NUMBER 4

#define BUTTON_START   0
#define BUTTON_1       30            /*  Charging & charge complete, 1: charging  0: complete */
#define BUTTON_2       0           /*  Chager connection, 0: charger connected */
#define BUTTON_3       9            /*  Button */
#define BUTTON_4       5			/*  MPU6500 INT */
#define BUTTON_STOP    30
#define BUTTON_PULL    GPIO_PIN_CNF_PULL_Disabled//NRF_GPIO_PIN_PULLUP

#define CHARGER_PIN     	BUTTON_1
#define CHARGER_CONNECT_PIN BUTTON_2
#define USER_KEY			BUTTON_3
#define MPU6500_INT			BUTTON_4

#define BUTTONS_LIST {BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4}

#define BSP_BUTTON_0   BUTTON_1
#define BSP_BUTTON_1   BUTTON_2
#define BSP_BUTTON_2   BUTTON_3
#define BSP_BUTTON_3   BUTTON_4

#define BSP_BUTTON_0_MASK (1<<BSP_BUTTON_0)
#define BSP_BUTTON_1_MASK (1<<BSP_BUTTON_1)
#define BSP_BUTTON_2_MASK (1<<BSP_BUTTON_2)
#define BSP_BUTTON_3_MASK (1<<BSP_BUTTON_3)

#define BUTTONS_MASK   0x001E0000

#define RX_PIN_NUMBER  19//15
#define TX_PIN_NUMBER  18//10
#define CTS_PIN_NUMBER 11
#define RTS_PIN_NUMBER 12
#define HWFC           false

#define SPIS_MISO_PIN  28    // SPI MISO signal. 
#define SPIS_CSN_PIN   12    // SPI CSN signal. 
#define SPIS_MOSI_PIN  25    // SPI MOSI signal. 
#define SPIS_SCK_PIN   29    // SPI SCK signal. 

#define SPIM0_SCK_PIN       3     /**< SPI clock GPIO pin number. */
#define SPIM0_MOSI_PIN      2     /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM0_MISO_PIN      6     /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM0_SS_PIN        4     /**< SPI Slave Select GPIO pin number. */

#define SPIM1_SCK_PIN       15     /**< SPI clock GPIO pin number. */
#define SPIM1_MOSI_PIN      12     /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM1_MISO_PIN      14     /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM1_SS_PIN        13     /**< SPI Slave Select GPIO pin number. */


#endif // CUSTOM_BOARD_H
